package com.dhms.vostok1.service.ble

import android.bluetooth.BluetoothDevice
import com.dhms.vostok1.data.BLEDevice
import com.dhms.vostok1.data.BLEDeviceType

interface BleServiceCallback {

    /**
     * 已连接
     */
    fun onConnected()

    /**
     * 发现设备
     * @param device
     * @param deviceType
     * @param power
     */
    fun onSpcDeviceFound(device: BluetoothDevice?, deviceType: BLEDeviceType, power: Float?)

    /**
     * 连接已断开
     */
    fun onDisconnected()

    /**
     * 获取数据错误
     */
    fun onCollectError()

    /**
     * 获取设备数据
     * @param deviceInfo 设备
     */
    fun onDeviceInfoDataReceived(deviceInfo: BLEDevice)

    /**
     * 获取温度信息
     * @param temperature 温度参数
     */
    fun onTemperatureDataReceived(temperature: Float)

    /**
     * 获取电量信息
     * @param percent
     * @param power
     */
    fun onPowerLevelDataReceived(percent: Float, power: Float?)

    /**
     * 获取震动信息
     * @param result
     */
    fun onVibAnalysisResultReceived(result: Map<String, Float>)

    /**
     * 获取震动数据
     * @param vibData 震动
     */
    fun onVibDataReceived(vibData: HashMap<String, Any>)

    /**
     * 更新数据回调
     */
    fun onUpgradeResult(progress: Float, succeed: Boolean?)
}